02. Run the Starter Code

KOTLIN PART2 L4 A02 Run The Starter Code

You can either download all the sample code to your computer…

Download Zip

…or clone the GitHub repository from the command line and checkout the starter branch.

$ git clone https://github.com/udacity/android-kotlin-geo-fences.git

The starter app contains code to help you get started. It contains some assets, layouts, the opening activity and a file with services that you will complete during this lesson.

Important classes provided for you:

  • HuntMainActivity.kt is the main class you will be working in. This class contains skeleton code for functions that handle permissions, adding geofences and removing geofences.
  • GeofenceViewModel.kt is the ViewModel associated with HuntMainActivity.kt. This class handles the LiveData and determines which hint should be shown on screen.
  • NotificationUtils.kt: When you enter a geofence, a notification pops up! This class creates and styles that notification.
  • activity_main.xml: This currently displays an image of an Android but you will implement it to display a hint.
  • GeofenceBroadcastReceiver.kt: This contains skeleton code for the onReceive() method of the BroadcastReceiver where you will handle
  1. Run the app on the emulator or on your own device, you should see the splash page.